<?php

namespace App\Models;


use App\ModelFilters\Qh_NoticeFilter;
use Carbon\Carbon;

class Qh_Notice extends BaseModel
{
    protected $table = 'qh_notices';

    protected $guarded = [];

    // protected $casts = [
    //     'created_at' => 'datetime:Y-m-d H:i:s'
    // ];

    public function getCreatedAtAttribute($v) {
        return $v ? Carbon::make($v)->timezone('Asia/Shanghai')->format('Y-m-d H:i:s') : $v;
    }

    public function modelFilter(): ?string
    {
        return $this->provideFilter(Qh_NoticeFilter::class);
    }
}
